/*     */ package com.umeng.fb.model;
/*     */ 
/*     */ import com.umeng.common.Log;
/*     */ import com.umeng.common.util.h;
/*     */ import java.util.HashMap;
/*     */ import java.util.Iterator;
/*     */ import java.util.Map;
/*     */ import java.util.Map.Entry;
/*     */ import java.util.Set;
/*     */ import org.json.JSONException;
/*     */ import org.json.JSONObject;
/*     */ 
/*     */ public class UserInfo
/*     */ {
/*  24 */   private static final String e = UserInfo.class.getName();
/*  25 */   int a = -1;
/*  26 */   String b = "";
/*     */   Map<String, String> c;
/*     */   Map<String, String> d;
/*     */ 
/*     */   public UserInfo()
/*     */   {
/*  33 */     this.c = new HashMap();
/*  34 */     this.d = new HashMap();
/*     */   }
/*     */ 
/*     */   UserInfo(JSONObject paramJSONObject) throws JSONException {
/*  38 */     this.a = paramJSONObject.optInt("age_group", -1);
/*  39 */     this.b = paramJSONObject.optString("gender", "");
/*  40 */     this.c = new HashMap();
/*  41 */     this.d = new HashMap();
/*     */ 
/*  43 */     JSONObject localJSONObject = paramJSONObject.optJSONObject("contact");
/*     */     Object localObject2;
/*  44 */     if (localJSONObject != null) {
/*  45 */       localObject1 = localJSONObject.keys();
/*  46 */       while (((Iterator)localObject1).hasNext()) {
/*  47 */         localObject2 = (String)((Iterator)localObject1).next();
/*  48 */         this.c.put(localObject2, localJSONObject.getString((String)localObject2));
/*     */       }
/*     */     }
/*  51 */     Object localObject1 = paramJSONObject.optJSONObject("remark");
/*  52 */     Log.c(e, localObject1);
/*  53 */     if (localObject1 != null) {
/*  54 */       localObject2 = ((JSONObject)localObject1).keys();
/*  55 */       while (((Iterator)localObject2).hasNext()) {
/*  56 */         String str = (String)((Iterator)localObject2).next();
/*  57 */         this.d.put(str, ((JSONObject)localObject1).getString(str));
/*     */       }
/*     */     }
/*     */   }
/*     */ 
/*     */   public JSONObject toJson() {
/*  63 */     JSONObject localJSONObject1 = new JSONObject();
/*     */     try {
/*  65 */       if (this.a > -1) {
/*  66 */         localJSONObject1.put("age_group", this.a);
/*     */       }
/*  68 */       if (!h.d(this.b))
/*  69 */         localJSONObject1.put("gender", this.b);
/*     */       JSONObject localJSONObject2;
/*     */       Iterator localIterator;
/*     */       Map.Entry localEntry;
/*  71 */       if ((this.c != null) && (this.c.size() > 0)) {
/*  72 */         localJSONObject2 = new JSONObject();
/*  73 */         for (localIterator = this.c.entrySet().iterator(); localIterator.hasNext(); ) { localEntry = (Map.Entry)localIterator.next();
/*  74 */           localJSONObject2.put((String)localEntry.getKey(), localEntry.getValue());
/*     */         }
/*  76 */         localJSONObject1.put("contact", localJSONObject2);
/*     */       }
/*  78 */       if ((this.d != null) && (this.d.size() > 0)) {
/*  79 */         localJSONObject2 = new JSONObject();
/*  80 */         for (localIterator = this.d.entrySet().iterator(); localIterator.hasNext(); ) { localEntry = (Map.Entry)localIterator.next();
/*  81 */           localJSONObject2.put((String)localEntry.getKey(), localEntry.getValue());
/*     */         }
/*  83 */         localJSONObject1.put("remark", localJSONObject2);
/*     */       }
/*     */     }
/*     */     catch (JSONException localJSONException) {
/*  87 */       localJSONException.printStackTrace();
/*     */     }
/*  89 */     return localJSONObject1;
/*     */   }
/*     */ 
/*     */   public int getAgeGroup()
/*     */   {
/*  94 */     return this.a;
/*     */   }
/*     */ 
/*     */   public void setAgeGroup(int paramInt) {
/*  98 */     this.a = paramInt;
/*     */   }
/*     */ 
/*     */   public String getGender() {
/* 102 */     return this.b;
/*     */   }
/*     */ 
/*     */   public void setGender(String paramString) {
/* 106 */     this.b = paramString;
/*     */   }
/*     */ 
/*     */   public Map<String, String> getContact() {
/* 110 */     return this.c;
/*     */   }
/*     */ 
/*     */   public void setContact(Map<String, String> paramMap) {
/* 114 */     this.c = paramMap;
/*     */   }
/*     */ 
/*     */   public Map<String, String> getRemark() {
/* 118 */     return this.d;
/*     */   }
/*     */ 
/*     */   public void setRemark(Map<String, String> paramMap) {
/* 122 */     this.d = paramMap;
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.fb.model.UserInfo
 * JD-Core Version:    0.6.2
 */